package com.ft.adbix.core.interactive;

public class ShakeConfiguration {
    private float threshold;
    private int minTimeBetweenShakes;
    private boolean enableVibration;
    private boolean enableSound;
    private int vibrationDuration;

    private ShakeConfiguration(Builder builder) {
        this.threshold = builder.threshold;
        this.minTimeBetweenShakes = builder.minTimeBetweenShakes;
        this.enableVibration = builder.enableVibration;
        this.enableSound = builder.enableSound;
        this.vibrationDuration = builder.vibrationDuration;
    }

    public static class Builder {
        private float threshold = 12.0f;
        private int minTimeBetweenShakes = 1000;
        private boolean enableVibration = true;
        private boolean enableSound = true;
        private int vibrationDuration = 200;

        public Builder setThreshold(float threshold) {
            this.threshold = threshold;
            return this;
        }

        public Builder setMinTimeBetweenShakes(int minTimeBetweenShakes) {
            this.minTimeBetweenShakes = minTimeBetweenShakes;
            return this;
        }

        public Builder enableVibration(boolean enable) {
            this.enableVibration = enable;
            return this;
        }

        public Builder enableSound(boolean enable) {
            this.enableSound = enable;
            return this;
        }

        public Builder setVibrationDuration(int duration) {
            this.vibrationDuration = duration;
            return this;
        }

        public ShakeConfiguration build() {
            return new ShakeConfiguration(this);
        }
    }
}